home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tk / getvisual.z / getvisual
Encoding:
Text File  |  1998-10-30  |  6.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll((((3333TTTTkkkk))))                                            TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_GetVisual - translate from string to visual
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  13.  
  14.      Visual *
  15.      TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll((((_i_n_t_e_r_p, _t_k_w_i_n, _s_t_r_i_n_g, _d_e_p_t_h_P_t_r, _c_o_l_o_r_m_a_p_P_t_r))))
  16.  
  17. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  18.      Tcl_Interp   *_i_n_t_e_r_p        (in)      Interpreter to use for error
  19.                                            reporting.
  20.  
  21.      Tk_Window    _t_k_w_i_n          (in)      Token for window in which the
  22.                                            visual will be used.
  23.  
  24.      char         *_s_t_r_i_n_g        (in)      String that identifies the desired
  25.                                            visual.  See below for valid
  26.                                            formats.
  27.  
  28.      int          *_d_e_p_t_h_P_t_r      (out)     Depth of returned visual gets
  29.                                            stored here.
  30.  
  31.      Colormap     *_c_o_l_o_r_m_a_p_P_t_r   (out)     If non-NULL then a suitable
  32.                                            colormap for visual is found and
  33.                                            its identifier is stored here.
  34.  
  35.  
  36. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  37.      TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll takes a string description of a visual and finds a suitable
  38.      X Visual for use in _t_k_w_i_n, if there is one.  It returns a pointer to the
  39.      X Visual structure for the visual and stores the number of bits per pixel
  40.      for it at *_d_e_p_t_h_P_t_r.  If _s_t_r_i_n_g is unrecognizable or if no suitable
  41.      visual could be found, then NULL is returned and TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll leaves an
  42.      error message in _i_n_t_e_r_p->_r_e_s_u_l_t.  If _c_o_l_o_r_m_a_p is non-NULL then
  43.      TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll also locates an appropriate colormap for use with the result
  44.      visual and stores its X identifier at *_c_o_l_o_r_m_a_p_P_t_r.
  45.  
  46.      The _s_t_r_i_n_g argument specifies the desired visual in one of the following
  47.      ways:
  48.  
  49.      _c_l_a_s_s _d_e_p_t_h    The string consists of a class name followed by an integer
  50.                     depth, with any amount of white space (including none) in
  51.                     between.  _c_l_a_s_s selects what sort of visual is desired and
  52.                     must be one of ddddiiiirrrreeeeccccttttccccoooolllloooorrrr, ggggrrrraaaayyyyssssccccaaaalllleeee, ggggrrrreeeeyyyyssssccccaaaalllleeee,
  53.                     ppppsssseeeeuuuuddddooooccccoooolllloooorrrr, ssssttttaaaattttiiiiccccccccoooolllloooorrrr, ssssttttaaaattttiiiiccccggggrrrraaaayyyy, ssssttttaaaattttiiiiccccggggrrrreeeeyyyy, or
  54.                     ttttrrrruuuueeeeccccoooolllloooorrrr, or a unique abbreviation.  _d_e_p_t_h specifies how
  55.                     many bits per pixel are needed for the visual.  If
  56.                     possible, TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll will return a visual with this
  57.                     depth; if there is no visual of the desired depth then
  58.                     TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll looks first for a visual with greater depth,
  59.                     then one with less depth.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll((((3333TTTTkkkk))))                                            TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      ddddeeeeffffaaaauuuulllltttt        Use the default visual for _t_k_w_i_n's screen.
  75.  
  76.      _p_a_t_h_N_a_m_e       Use the visual for the window given by _p_a_t_h_N_a_m_e.  _p_a_t_h_N_a_m_e
  77.                     must be the name of a window on the same screen as _t_k_w_i_n.
  78.  
  79.      bbbbeeeesssstttt ?_d_e_p_t_h?   Choose the ``best possible'' visual, using the following
  80.                     rules, in decreasing order of priority:  (a) a visual that
  81.                     has exactly the desired depth is best, followed by a
  82.                     visual with greater depth than requested (but as little
  83.                     extra as possible), followed by a visual with less depth
  84.                     than requested (but as great a depth as possible); (b) if
  85.                     no _d_e_p_t_h is specified, then the deepest available visual
  86.                     is chosen; (c) ppppsssseeeeuuuuddddooooccccoooolllloooorrrr is better than ttttrrrruuuueeeeccccoooolllloooorrrr or
  87.                     ddddiiiirrrreeeeccccttttccccoooolllloooorrrr, which are better than ssssttttaaaattttiiiiccccccccoooolllloooorrrr, which is
  88.                     better than ssssttttaaaattttiiiiccccggggrrrraaaayyyy or ggggrrrraaaayyyyssssccccaaaalllleeee; (d) the default
  89.                     visual for the screen is better than any other visual.
  90.  
  91.  
  92. CCCCRRRREEEEDDDDIIIITTTTSSSS
  93.      The idea for TTTTkkkk____GGGGeeeettttVVVViiiissssuuuuaaaallll, and the first implementation, came from Paul
  94.      Mackerras.
  95.  
  96.  
  97. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  98.      colormap, screen, visual
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.